/**
 * 基础widget 
 */
BaseWidget = OpenLayers.Class({
	
	id:"",
	
	map:null,
	
	title:"",
	
	icon:"",
	
	config:"",
	
	state:"maximized",
	
	setId: function(/*Number*/ id) {
		this.id = id;
	},
	
	setTitle: function (/*String*/ title) {
		this.title = title;
	},
	
	setIcon: function (/*String*/ icon) {
		this.icon = icon;
	},
	
	setConfig: function (/*String*/ config) {
		this.config = config;
	},
	
	setState: function (/*String*/ state) {
		this.state = state;
	},
	
	setMap: function (/*esri.Map*/ map) {
		this.map = map;
	},
	
	initialize: function() {
		
	},
	/**
	 *请求加载JS文件 
	 * @param {Object} label
	 */	
	requireWidgetJs : function(label){
		var jsNode = document.createElement('script');
        jsNode.setAttribute('src', label);
        jsNode.setAttribute('type', 'text/javascript');
		document.getElementsByTagName('head')[0].appendChild(jsNode); 
		//有这种写法，试了下，可以用
		// $.getScript(label,function(){});	
	},
	requireWidgetCSS : function(css){
		var CSSNode = document.createElement('link');
        CSSNode.setAttribute('href', css);
        CSSNode.setAttribute('rel', 'stylesheet');
        CSSNode.setAttribute('type', 'text/css');
		document.getElementsByTagName('head')[0].appendChild(CSSNode); 
	},
	CLASS_NAME:"openGis.BaseWidget"
});

